const myPool = require("../sqlPoor")
const tool = require("../tool");
module.exports = {
    do(sql, arr, timer, dos) {//dos是回调函数
        let now = new Date().getTime() - 1000000000000
        if (!timer || now - Number(tool.decodeTimer(timer)) > 10000) {
            dos(null, { code: -2 })
            return
        }
        myPool.connect(sql, arr, function (err, data) {
            data = {
                data,
                code: 1
            }
            dos(err, data)
        })
    },
    do2(sql, arr, dos) {//dos是回调函数
        console.log(sql)
        myPool.connect(sql, arr, function (err, data) {
            data = {
                data,
                code: 1
            }
            dos(err, data)
        })
    },
}
